from sqlalchemy import Column, String, DateTime, DECIMAL, Integer, FLOAT

from sqlConfig import Base


class Humidity(Base):
    __tablename__ = 'humidity'

    id = Column(Integer, primary_key=True, autoincrement=True)

    dormitoryId = Column(String(12), nullable=False)

    humidity = Column(FLOAT(8), nullable=False)

    dateTime = Column(DateTime(), nullable=False)

    def __init__(self, userId, humidity, date):
        self.dormitoryId = userId
        self.humidity = humidity
        self.dateTime = date
